<template>
	<view>
		<view class="header">
			<view class="center mt20">
				<!-- 学校名称 -->
				<view class="dflex alc jcsb auto item">
					<view class="fs32 color">学校名称</view>
					<view>
						<u--input
							placeholder="请填写学校名称"
							border="0"
							fontSize="32rpx"
							color="#333"
							inputAlign="right"
						></u--input>
					</view>
				</view>
				<!-- 学校名称结束 -->
				<!-- 选择学校的省市区 -->
				<view class="dflex alc jcsb auto item">
					<view>省市区</view>
					<PickRegions :defaultRegion="defaultRegionCode" @getRegion="handleGetRegion">
						<u--input
							placeholder="请选择学校所在区域"
							disabled
							border="0"
							fontSize="32rpx"
							v-model="address"
							inputAlign="right"
							:customStyle="{
								backgroundColor: '#fff',
								zIndex: 99,
								marginRight: '20rpx'
							}"
						></u--input>
					</PickRegions>

					<view style="right: 30rpx" class="posia z-999">
						<u-icon name="arrow-right" color="#999999" size="20"></u-icon>
					</view>
				</view>
				<!-- 选择学校地区结束 -->
				<!-- 添加年级 -->
				<view class="dflex alc jcsb auto item">
					<view class="fs32 color">添加年级</view>
					<view>
						<image
							src="../static/add.png"
							mode="heightFix"
							style="width: 40rpx;height: 40rpx;"
						></image>
					</view>
				</view>
				<!-- 添加年级结束 -->
				<!-- 年级情况 -->
				<view
					class="dflex alc jcsb auto item"
					style="height: 174rpx;"
					v-for="item in 5"
					@click="goDetails"
				>
					<view class="fs32 color">
						<view>一年级</view>
						<view class="fs28 gray mt10">共计：十五个班，580人</view>
					</view>
					<view><u-icon name="arrow-right" color="#999999" size="20"></u-icon></view>
				</view>
				<!-- 年级情况结束 -->
				<view class="button dflex alc jcc mt20"><view class="btn textc white">确认修改</view></view>
			</view>
		</view>


	</view>
</template>

<script>
import tabbar from '@/components/tabbar/tabbar.vue';
import PickRegions from '../../pagesB/components/pick-regions/pick-regions.vue';
export default {
	onLoad() {
		uni.setStorageSync('indexType', 4);
	},
	components: {
		tabbar,
		PickRegions
	},
	data() {
		return {
			defaultRegionCode: '410105', //默认的区域
			address: '', //选择的区域
			region: []
		};
	},
	methods: {
		//跳转到报备记录页面
		goRecord() {
			uni.navigateTo({
				url: '/pagesC/record/record'
			});
		},
		//跳转班级详情页面
		goDetails() {
			uni.navigateTo({
				url: '/pagesC/classdetails/classdetails'
			});
		},
		// 获取选择的地区
		handleGetRegion(region) {
			this.region = region;
			this.address = `${region[0].name}-${region[1].name}-${region[2].name}`;
		}
	}
};
</script>

<style lang="scss" scoped>
page {
	background-color: #F2F5F9;
}
.header {
	width: 750rpx;
	height: 560rpx;
	padding: 0.1rpx;
}
.center {
	width: 750rpx;

	background: #ffffff;
}
.item {
	height: 124rpx;
	width: 690rpx;
	border-bottom: 2rpx solid #eaeaea;
}
.button {
	width: 750rpx;
	height: 140rpx;
	background: #ffffff;
}
.btn {
	width: 690rpx;
	height: 100rpx;
	line-height: 100rpx;
	background: linear-gradient(90deg, #8092eb 0%, #4151db 100%);
	border-radius: 10rpx;
}
</style>
